home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Programming / imageioproc.lib / dev / includes / imageprocess / imageprocess.h
Encoding:
C/C++ Source or Header  |  2000-08-17  |  5.6 KB  |  144 lines

  1. #ifndef IMAGEPROCESS_H
  2. #define IMAGEPROCESS_H
  3.  
  4. /*
  5. **    $VER: imageprocess.h 1.0 (30.6.2000)
  6. **
  7. **    Public structures and defintions for imageprocess.library.
  8. **
  9. **    © Paul Huxham
  10. */
  11.  
  12. #ifndef EXEC_TYPES_H
  13. #include "exec/types.h"
  14. #endif
  15.  
  16. #ifndef UTILITY_TAGITEM_H
  17. #include <utility/tagitem.h>
  18. #endif
  19.  
  20. #ifndef IMAGEGENERIC_H
  21. #include <imageio/imagegeneric.h>
  22. #endif
  23.  
  24. /*========================================================================*/
  25. /* Imageprocess handle */
  26. struct ImageProcessHandle
  27. {
  28.     ULONG private;
  29. };
  30.  
  31. /*========================================================================*/
  32. /* Process types */
  33. enum
  34. {
  35.     IMP_Process_Scale = 1,
  36.     IMP_Process_Balance,
  37.     IMP_Process_AutoGamma,
  38.     IMP_Process_Negative,
  39.     IMP_Process_Rotate,
  40.     IMP_Process_Crop,
  41.     IMP_Process_SwapColourSpace,
  42. };
  43.  
  44. /*========================================================================*/
  45. /* imageprocess.library scale types */
  46. enum
  47. {
  48.     IPSCALE_FAST = 0,
  49.     IPSCALE_NORMAL,
  50.     IPSCALE_BEST,
  51. };
  52.  
  53. /*========================================================================*/
  54. /* imageprocess.library auto gamma types */
  55. #define GAMMA_BEST 0
  56. #define GAMMA_FAST 1
  57.  
  58. /*========================================================================*/
  59. /* Public callback hooks called during processing */
  60.  
  61. /* The progress hook is called once for each scanline in the image.
  62.         d0 contains a ULONG with the current scanline number (1-n).
  63.         d1 contains a ULONG with the total number of scanlines.
  64.         a0 contains the userdata
  65.  
  66.     If the hook returns a non NULL value, the processing will be aborted.
  67. */
  68.  
  69. typedef ULONG (*IMPP_HOOK)( ULONG, ULONG, void * );
  70. typedef __asm ULONG (*IMPP_HOOK_PROTO)( register __d0 ULONG, register __d1 ULONG, register __a0 void * );
  71.  
  72. /* The render hook is called once for each processed scanline in the image.
  73.         a0 contains a UBYTE pointer to the scanline data
  74.         d0 contains a ULONG with the scanline number of this data (1 being
  75.                 first scanline)
  76.         d1 contains a ULONG with the number of bytes in this row
  77.         a1 contains the userdata
  78.  
  79.     If the hook returns a non NULL value, the processing will be aborted.
  80. */
  81.  
  82. typedef ULONG (*IMPR_HOOK)( void *, ULONG, ULONG, void * );
  83. typedef __asm ULONG (*IMPR_HOOK_PROTO)( register __a0 void *, register __d0 ULONG, register __d1 ULONG, register __a1 void * );
  84.  
  85. /*========================================================================*/
  86. /* Imageprocess tagbase */
  87. #define IMP_TB ( TAG_USER + 0x80000 )
  88.  
  89. /* Imageprocess tags requiring V1.0 */
  90. #define IMP_SourceImageIOHandle IMP_TB + 1 /* Pointer to valid source imageio.library handle (struct ImageHandle *) */
  91. #define IMP_SourceBuffer IMP_TB + 2 /* Source buffer (UBYTE *) */
  92. #define IMP_SourceWidth IMP_TB + 3 /* Width of image in pixels (ULONG) */
  93. #define IMP_SourceHeight IMP_TB + 4 /* Height of image in pixels (ULONG) */
  94. #define IMP_SourceBytesPerPixel IMP_TB + 5 /* Bytes per pixel (ULONG) */
  95. #define IMP_SourceColourSpace IMP_TB + 6 /* Type of colour space (ULONG) */
  96.  
  97. #define IMP_MemoryPool IMP_TB + 7 /* Pointer to memory pool to allocate memory on */
  98.  
  99. #define IMP_Buffer IMP_TB + 10 /* New destination buffer (if created one) (UBYTE **) */
  100. #define IMP_BufferSize IMP_TB + 11 /* Size of destination buffer in bytes (ULONG *) */
  101. #define IMP_Width IMP_TB + 12 /* Final width of image in pixels (ULONG *) */
  102. #define IMP_Height IMP_TB + 13 /* Final height of image in pixels (ULONG *) */
  103. #define IMP_BytesPerPixel IMP_TB + 14 /* Bytes per pixel (ULONG *) */
  104. #define IMP_ColourSpace IMP_TB + 15 /* Colour space (ULONG *) */
  105.  
  106. #define IMP_ProcessInline IMP_TB + 16 /* Process the buffer inline, dont allocate a new buffer (BOOL) */
  107.  
  108. #define IMP_ProcessLines IMP_TB + 20 /* How many scanlines to process between calls to callback hooks, defaults to 1 (ULONG) (NOT IMPLEMENTED) */
  109. #define IMP_ProgressHook IMP_TB + 21 /* Pointer to a function to display progress status (NOT IMPLEMENTED) */
  110. #define IMP_ProgressUserData IMP_TB + 22 /* Pointer to user data (void *) (NOT IMPLEMENTED) */
  111. #define IMP_RenderHook IMP_TB + 23 /* Pointer to a function to render scan lines (NOT IMPLEMENTED) */
  112. #define IMP_RenderUserData IMP_TB + 24 /* Pointer to user data (void *) (NOT IMPLEMENTED) */
  113.  
  114. /* Scale */
  115. #define IMP_ScaleNum IMP_TB + 30 /* Numerator for scaling, defaults to 1 (ULONG) */
  116. #define IMP_ScaleDenom IMP_TB + 31 /* Denomenator for scaling (ULONG) */
  117. #define IMP_ScaledWidth IMP_TB + 32 /* Width of scaled image in pixels (ULONG *) */
  118. #define IMP_ScaledHeight IMP_TB + 33 /* Height of scaled image in pixels (ULONG *) */
  119. #define IMP_ScaleMaintainAspect IMP_TB + 34 /* Maintain aspect ratio when scaling (BOOL) */
  120. #define IMP_ScaleType IMP_TB + 35 /* Defined above (ULONG) */
  121.  
  122. /* Swap colour space */
  123. #define IMP_NewColourSpace IMP_TB + 40 /* Type of colour space to make the dest (ULONG) */
  124.  
  125. /* Auto gamma correction */
  126. #define IMP_GammaMode IMP_TB + 45 /* Mode of gamma correction (ULONG) */
  127.  
  128. /*========================================================================*/
  129. /* Defined error return codes */
  130. #define IMPERR_NONE 0 /* No error */
  131. #define IMPERR_NOMEMORY 1 /* Insufficient memory */
  132. #define IMPERR_NOHANDLE 2 /* No imageprocess handle */
  133. #define IMPERR_NOIMAGEIOHANDLE 3 /* No imageio source handle */
  134. #define IMPERR_NOBUFFER 4 /* No image buffer */
  135. #define IMPERR_MISSINGTARGET 5 /* Missing target variable pointer */
  136. #define IMPERR_BADSCALESIZE 6 /* Out of range scaling parameters */
  137. #define IMPERR_INCOMPATTAGS 7 /* Incompatible tags */
  138. #define IMPERR_CANTPROCESS 8 /* Cant process buffer */
  139. #define IMPERR_INLINE 9 /* Buffer mode is inline */
  140. #define IMPERR_MISSINGPARAM 10 /* Buffer parameter missing in alloc */
  141. #define IMPERR_UNSUPPORTEDCS 11 /* Unsupported colour space */
  142.  
  143. #endif /* IMAGEPROCESS_H */
  144.